package com.bpc.cs.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 * @author   phan_tp
 * @datetime Dec 10, 2012 : 2:00:01 PM
 */
public class BaseDAO {
	private static SessionFactory sessionFactory;

	/**
	 * Get current hibernate session factory
	 * @return Session
	 */
	public Session getSession () {
		return getSessionFactory().getCurrentSession();
	}

	/** Get Hibernate Session Factory
	 * @return SessionFactory - Hibernate Session Factory
	 */
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	/**
	 * Set Hibernate Session Factory
	 * @param sessFactory - Hibernate Session Factory
	 */
	public void setSessionFactory(SessionFactory sessFactory) {
		sessionFactory = sessFactory;
	}


}
